package com.monkeygroup.mygoplus.view.entrance.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.monkeygroup.mygoplus.R;
import com.monkeygroup.mygoplus.base.BaseActivity;
import com.monkeygroup.mygoplus.view.home.activity.PublishedChooseAddrActivity;

/**
 * 负责声明
 * Created by cumt on 2017/6/15.
 */

public class RegisterPrivacyActivity extends BaseActivity {

    public static void gotoActivity(Activity activity,int type) {
        Intent intent = new Intent(activity,
                RegisterPrivacyActivity.class);

        intent.putExtra("type",type);
        activity.startActivityForResult(intent,11);

    }

    private TextView txt_privacy_content;
    //头部
    private TextView txtTitle;
    private ImageView imgBack;

    private int type;
    @Override
    public void setContentView() {
        setContentView(R.layout.activity_privacy);
    }

    @Override
    public void initView() {

        txtTitle =  (TextView)findViewById(R.id.txt_title);

        imgBack =  (ImageView)findViewById(R.id.img_back);

        txt_privacy_content= (TextView)findViewById(R.id.txt_privacy_content);

        Intent intent = this.getIntent();
        Bundle bundle =  intent.getExtras();
        type = bundle.getInt("type");
        String detail="";
        if(type==1){
            txtTitle.setText("服務條款");
            detail=getString(R.string.register_privacy_content_I);
        }
        else if(type==2){
            txtTitle.setText("隱私政策");
            detail=getString(R.string.register_privacy_content_II);
        }
        else if(type==3){
            txtTitle.setText("負責聲明");
            detail=getString(R.string.register_privacy_content_III);

        }

        txt_privacy_content.setMovementMethod(ScrollingMovementMethod.getInstance());
        txt_privacy_content.setText(Html.fromHtml(detail));

    }

    @Override
    public void setListener() {
        imgBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

    }

    @Override
    public void doEvent() {

    }
}
